<?php
	require_once('../app.php');
	$dbCompanies = Db::getModel('companies');
	$companies = $dbCompanies->findByFull(array("status"=>"='active'"));

	$str ="";

	foreach($companies as $key=>$var){
		$str .="<url>\n";
			$str .= "\t<loc>http://www.consumerprotectionagency.org/company/view/".$var[id]."/"._replace(htmlspecialchars($var['title']))."</loc>\n";
		$str .= "</url>\n";
	}

	file_put_contents("sitemap.xml",$str,FILE_APPEND);
?>